#pragma once

#include <iostream>

#include "pickingcolormanager.h"

class Pickable{
    public:
        Pickable();

        virtual void Draw()=0;
        virtual void Pick()=0;
        virtual bool CheckID(unsigned int id){ return id==GetID(); }


        virtual void Clicked(){ std::cout<<"Pickable clicked"<<std::endl; };
        void PrintPickingColor(){ std::cout<<"["<<pickingColor[0]<<", "<<pickingColor[1]<<", "<<pickingColor[2]<<"]"<<std::endl; }
        void PrintID(){ std::cout<<"["<<GetID()<<"]"<<std::endl; }

        void SetPickingColor(unsigned int pickingColor[]);
        void SetPickingColor(PickingColorManager *pcm);
        bool PickingColorIsSet(){ if(pickingColor[0]==0 && pickingColor[1]==0 && pickingColor[2]==0) return false; else return true; }

        void GenerateNewID();

        unsigned int GetID();

        int r(){ return pickingColor[0]; }
        int g(){ return pickingColor[1]; }
        int b(){ return pickingColor[2]; }

    private:
        unsigned int pickingColor[3];
};
